1. Field of the Invention
The present invention relates to the maintenance of multiple copies of a database. More specifically, synchronizing multiple copies of a database located on different servers.
2. Background
The use of databases in conjunction with various types of networks is increasing with the growth of networks and network technology. In many situations, it is desirable to manage databases in a distributed manner; i.e., multiple copies of a particular database are stored on different servers connected to a network. Distributed databases provide redundancy such that when a single server fails, the database is accessible through the remaining servers which contain identical copies of the database. Additionally, distributed databases function to distribute the load between multiple servers. Thus, instead of providing a single server to be accessed by all users seeking to retrieve information from the database, several different servers are provided. In this situation, each server supports a subset of users, thereby distributing the load among the various servers. As discussed above, if a single server fails, each remaining server can process a portion of the database requests destined for the failed server.
When a database is distributed such that multiple servers maintain redundant copies of the database, it is important to keep the various copies of the database identical. Maintaining the integrity of the databases includes updating and modifying each database to ensure that all copies of the database are identical. To accomplish this, the various servers must communicate with one another to control and exchange information regarding any modifications to the database. When the database copy on a particular server has been modified, the modified records must not be altered by other servers until all database copies have been updated. Distributed locking schemes are typically used to provide one server with exclusive access to some portion of the database, allowing it to modify a particular record in the database. This type of locking scheme "locks" the remaining servers out of the modified record until the modification is completed and all servers have been updated.
Initial database "synchronization" must be performed when a new server is added to a network or a server is initialized after a server failure or a loss of connection with the network. In these situations, the synchronization process may require copying the entire database from an existing server to the new un-initialized server.
A known technique for synchronizing databases halts all database modifications on all servers until the synchronization process is completed. This method ensures that database records will not be modified during the synchronization process. However, access to the database will be restricted during the synchronization process. If the database being synchronized is large, the delay associated with the synchronization may be unacceptably long. Using this synchronization technique, the delay associated with synchronization increases as the size of the database increases. Furthermore, if the database records are being modified frequently, a large number of transactions will be delayed during the synchronization process.
Another existing technique for synchronizing databases creates a complete copy of the database to be used during the synchronization process. This method permits the existing databases to be modified during the synchronization process, since a copy of the database has already been saved. Any modifications processed during the synchronization process must also be communicated to the new server before the new server can begin servicing database client requests. Although this method prevents database access for a shorter period of time (while a copy of the database is created), the cost associated with this method may be considerably greater than the previous method discussed above. The cost of creating a copy of the database is proportional to the size of the database. A small database will require a corresponding small amount of memory or disk storage area to temporarily store a copy of the database. A larger database will require a greater amount of memory or disk storage area to store the database copy. This dedicated memory or disk storage area increases the overall cost of the server. Additionally, if the size of the database exceeds the available memory or disk storage area, then a copy of the database cannot be created until the memory or disk storage of the server is increased. In this situation, database synchronization cannot be performed due to insufficient server resources. Therefore, it is possible for a database to "outgrow" the capabilities of the server on which the database resides when this synchronization technique is used.
In view of the problems associated with the above synchronization techniques, it is desirable to provide a synchronization system which minimizes both the time during which database access is halted and the cost associated with making copies of the database.